package SeedBank

/**
 * This class is used to make a custom tag that creates an unobtrusive tag to let the
 * user log in and out.
 * 
 * @author Vikram Somu
 *
 */

class LoginTagLib {
	def loginLogout = {
		if(session.user){
			out << "You are logged in as ${session.user.login} |"
			out << """${link(action:"logout", controller:"user"){"Logout"}}"""
		} else {
			out << """${link(action:"login", controller:"user"){"Login"}}"""
		}
	}
}